<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.iris.egrant.service.ServiceUtils"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common-app/taglibs.jsp"%>
<%@ include file="/common/meta.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title></title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<script type="text/javascript" src="${res_app}/js/app/product.js"></script>
	<script type="text/javascript">
		var parenttbl = "tblExecuteProducts";
		var parentsel = "selExecuteProducts";
		var parentTable = parent.$("#tblExecuteProducts");
		var addflag="";
		var selectRadio = $();									//父页面选中的单选框
		var selectTr = $();		
	
		
		function InitData()
		{
			if(!IsAdd())
			{
				dataLoad("tblExecuteProducts","fragment-tab1");
			}
		 
			<c:if test="${param.flag=='view'}">
			document.getElementById("btype_value_name").parentElement.innerHTML = document.getElementById("btype_value_name").value;
			document.getElementById("ctype_value_name").parentElement.innerHTML = document.getElementById("ctype_value_name").value;
			
			//以下是查看页面
			DisabledAll("input");
			DisabledAll("select");
			DisabledAll("textarea");
			$(".datepick-trigger").css("display","none");
			//document.getElementById('btn_cg_date').style.display="none";
			var objs=document.getElementsByTagName("SPAN");
			for(index=0;index<objs.length;index++)
			{
				var cs=objs[index].className;
				if(cs=='color_red')
				{
					objs[index].innerHTML='';
				}
			}
			</c:if>
		 
		}
		function ValData()
		{	
			
			validate($("#fragment-tab1"),"基本信息");
			if($("[name='tname']").val() == "" && $("[name='en_tname']").val() == ""){
				irisValaddMsg("基本信息-->会议论文基本信息中的标题的中文与外文必须至少填写一个");
			}
			
			if($("[name='miaosu']").val() == "" && $("[name='en_miaosu']").val() == ""){
				irisValaddMsg("基本信息-->会议论文基本信息中的摘要的中文与外文必须至少填写一个");
			}
			if($("[name='keywords']").val() == "" && $("[name='keywords']").val() == ""){
				irisValaddMsg("基本信息-->会议论文基本信息中的关键词的中文与外文必须填至少写一个");
			}
			
			validateByTabRow($("#tblResultPsns"),"作者详情",1);
			if(ValOwnFlag() == false){
				irisValaddMsg("作者详情中必须有本人的记录");
			}
		}
	</script>
  </head>

  <body onload="">
   <c:set var="eXML">
   		<%=ServiceUtils.decodeFromDes3(java.net.URLDecoder.decode(request.getParameter("xmlData"))) %>
   </c:set>
   
  			<x:parse xml="${eXML}" var="myoutput"/>
  				 <div style="position: relative;">
  				
  				<div id="tabnav">
					<ul>
						<li class="down" id="tab1" onclick="changeTab(this.id)"><a href="###"><span>基本信息</span>
						</a></li>
						<li id="tab2" onclick="changeTab(this.id)"><a href="###"><span>作者详情</span>
						</a></li>
					</ul>
		       </div>	
				<input type="hidden" value="prize" name="result@result_type">
				<input type="hidden" value="1" name="category_id">
				
				<DIV class="dojoTabPaneWrapperDiy" id="dojoTabParent" >
				 
					<div id="fragment-tab1" class="tab_box" label="基本信息" >	
						<table  class="t_css" cellpadding="0" cellspacing="0"  width="100%" align="center">
							<tr>
								<td colspan="5" class="t_bar">
									&nbsp;会议论文基本信息
									<input type="hidden" maxlength="30" value="${param.product_type_name}" name="product_type_name" style="width:420px">
									<input type="hidden" maxlength="30" value="${param.product_type}" name="product_type" style="width:520px">
									<!-- 
									<input type="hidden" value="4" name="product_type">
									 -->
								</td>
							</tr>
							<tr>
								<td  align="right" rowspan="2">
									<span class="color_red">*</span>标题：
								</td>
								<td align="center">
									中文
								</td>
								<td colspan="3">
									<input type="text" maxlength="200" value="" name="tname" style="width:420px">
								</td>
							</tr>
							<tr>
								<td align="center">
									外文
								</td>
								<td colspan="3">
									<input type="text" maxlength="200" value="" name="en_tname" style="width:420px">
								</td>
							</tr>
							<tr>
								<td  align="right" colspan="2">
									<span class="color_red">*</span>类型：
								</td>
								<td colspan="3">
									<input type="radio" name="btype" id="btype" value="1" class="radioButton" onClick="setRadioSelectedValue(this.value,'btype_value','邀请会议论文')"/>邀请会议论文
									<input type="radio" name="btype" id="btype" value="2" class="radioButton" onClick="setRadioSelectedValue(this.value,'btype_value','推荐会议论文')"/>推荐会议论文
									<input type="radio" name="btype" id="btype" value="3" class="radioButton" onClick="setRadioSelectedValue(this.value,'btype_value','其他会议论文')"/>其他会议论文
									<input type="hidden" name="btype_value_name" id="btype_value_name" value=""/>
									<input type="hidden" name="btype_value" id="btype_value" value="" class="required"  label="类型"/>
								</td>
							</tr>
							<tr>
								<td align="right" colspan="2">
									<span class="color_red">*</span>他人引用次数：
								</td>
								<td colspan="3">
									<input type="text" value="" name="yinyong_num" style="width:195px" onfocus="InitInput.setInt(this)" class="required"  label="他人引用次数">
								</td>
							</tr>
							<tr>
								<td  align="right" colspan="2">
									<span class="color_red">*</span>会议名称：
								</td>
								<td colspan="3">
									<input type="text" maxlength="200" value="" name="conferencename" style="width:420px" class="required"  label="会议名称">
								</td>
							</tr>
							
							<tr>
								<td  align="right"  colspan="2">
									<span class="color_red">*</span>会议组织者：
								</td>
								<td colspan="3">
									<input type="text" maxlength="200" value="" name="conferenceman" style="width:420px" class="required"  label="会议组织者">
								</td>
							</tr>
							
							<tr>
								<td  align="right"  colspan="2">
									<span class="color_red">*</span>会议开始日期：
								</td>
								<td>
									<cpt:date id="cs_date"  value="" label="会议开始日期"  className="required date"  name="cs_date"></cpt:date> 
								</td>
								<td align="right" nowrap>
									<span class="color_red">*</span>会议结束日期：
								</td>
								<td>
									<cpt:date id="ce_date"  value="" label="会议结束日期"  className="required date"  name="ce_date"></cpt:date> 
								</td>
							</tr>
							
							<tr>
								<td  align="right"  colspan="2">
									<span class="color_red">*</span>论文类别：
								</td>
								<td colspan="3">
									<input type="radio" name="ctype" id="ctype" value="1" class="radioButton" onClick="setRadioSelectedValue(this.value,'ctype_value','特邀报告')"/>特邀报告
									<input type="radio" name="ctype" id="ctype" value="2" class="radioButton" onClick="setRadioSelectedValue(this.value,'ctype_value','口头报告')"/>口头报告
									<input type="radio" name="ctype" id="ctype" value="3" class="radioButton" onClick="setRadioSelectedValue(this.value,'ctype_value','墙报展示')"/>墙报展示
									<input type="hidden" name="ctype_value_name" id="ctype_value_name" value=""/>
									<input type="hidden" name="ctype_value" id="ctype_value" value="" class="required"  label="论文类别"/>
								</td>
							</tr>
							
							<tr>
								<td  align="right"  colspan="2">
									<span class="color_red">*</span>起止页码：
								</td>
								<td colspan="3">
									<input onfocus="InitInput.setInt(this)" type="text" value="" name="page1" style="width:195px" class="required"  label="起止页码的起始页"> 
									- <input onfocus="InitInput.setInt(this)" type="text" value="" name="page2" style="width:195px" class="required"  label="起止页码的结束页">
								</td>
							</tr>
							
							<tr>
								<td align="right"  colspan="2">
									<span class="color_red">*</span>国家或地区：
								</td>
								<td>
									<input type="text" value="" name="country" maxlength="100" style="width:195px" class="required" label="国家或地区" >
								</td>
								<td align="right" nowrap>
									<span class="color_red">*</span>城市：
								</td>
								<td>
									<input type="text" value="" name="city" maxlength="100" style="width:195px" class="required" label="城市">
								</td>
							</tr>
							
							
						<tr>
							
							<td align="right" colspan="2">
								<span class="color_red">*</span>发表日期：</span>
							</td>
							<td >
							   <cpt:date id="cg_date"  value="" label="发表日期"  className="required date"  name="cg_date"></cpt:date> 
							</td>
							<td align="right" nowrap>
								收录情况：
							</td>
							<td>
								<input type="checkbox" name="item" class="checkbox" value="1">
								EI
								<input type="checkbox" name="item" class="checkbox" value="2">
								SCI
								<input type="checkbox" name="item" class="checkbox" value="3">
								ISTP
								<input type="checkbox" name="item" class="checkbox" value="4">
								SSCI
								<input type="hidden" id="record_status" value="" />
								<input type="hidden" id="identify_name" name="identify_name" />
							</td>
						</tr>
							
							
							<tr>
								<td align="right" rowspan="2">
									<span class="color_red">*</span>摘要：<br>（限1000字）
								</td>
								<td align="center">
								中文
								</td>
								<td colspan="3">
								    <textarea name="miaosu" rows="5" cols="50" class="maxlength:1000"  label="中文摘要"></textarea>
									 
								</td>
							</tr>
							<tr>
								<td align="center">
									外文
								</td>
								<td colspan="3">
								<textarea name="en_miaosu" rows="5" cols="50" class="maxlength:1000"  label="外文摘要"></textarea>
								</td>
							</tr>
							<tr>
								<td align="right" rowspan="2">
									<span class="color_red">*</span>关键词：<br>（限1000字）
								</td>
								<td align="center">
								  中文
								</td>
								<td colspan="3">
								 <textarea name="keywords" rows="5" cols="50" class="maxlength:1000"  label="中文关键词"></textarea>
									
								</td>
							</tr>
							<tr>
								<td align="center">
									外文
								</td>
								<td colspan="3">
								<textarea name="en_keywords" rows="5" cols="50" class="maxlength:1000"  label="外文关键词"></textarea>
								</td>
							</tr>
							<tr>
								<td  align="right"  colspan="2">
									备注(限250字)：
								</td>
								<td colspan="3">
									<textarea rows="5" cols="50" name="remark" class="maxlength:250"  label="备注"></textarea>
								</td>
							</tr>
							<tr>
								<td  align="right" colspan="2">
									全文链接：
								</td>
								<td colspan="3">
									<input type="text" value="" name="lianjie" style="width:420px" maxlength="100">
									<input type="hidden" value="" name="xmldata" style="width:420px">
									<input type="hidden" value="" name="psn_name" style="width:420px">
									<input type="hidden" value="" name="paiwei" style="width:420px">
									
								</td>
							</tr>
						</table>
					</div>
					<div id="fragment-tab2" class="tab_box" label="作者详情" style="display:none">
						 
                     <table id="tblResultPsns" class="table01" cellpadding="0" cellspacing="0"  width="100%" align="center">
							<thead>
							<tr >
								<c:if test="${param.flag!='view'}">
								<th class="TblHead"  align="center" width="30px" nowrap="true">选择</th>
								</c:if>
								<th class="TblHead"  align="center" width="25px" nowrap="true">序号</th>
								<th class="TblHead"  align="center" width="50px">姓名</th>
								<th class="TblHead"  align="center" >所在单位</th>
								<th class="TblHead"  align="center" width="80px">电子邮箱</th>
								<th class="TblHead"  align="center" width="80px">是否通讯作者</th>
								<th class="TblHead"  align="center" width="80px">是否本人</th>
							</tr>
							</thead>
							<tbody>
							<c:if test="${param.flag!='view'}">
								<tr style="display:none">
									<td  nowrap="true">
										<input type="radio" class="radiobutton" name="selResultPsns" >
									</td>
									<td nowrap="true">&nbsp;<span  name="persons|person[0]@seq_no" >[index]</span></td>
									<td><input type="text"  class="input_text required" label="姓名"  value="" maxlength="10" name="persons|person[0]|cname"/></td>
									<td><input type="text"  class="input_text required"   label="所在单位" value="" maxlength="30" name="persons|person[0]|org_name"/></td> 
									<td><input type="text"  class="input_text required email"  label="邮箱"  value="" maxlength="30" name="persons|person[0]|email"/></td>
									<td>
									<input type="checkbox" value=""  class="checkbox" name="flag_corresponding" />
									<input type="hidden" name="persons|person[0]|flag_corresponding_name"/>
									</td>
									<td>
									<input type="radio" value=""  class="radiobutton" name="flag_own"/>
									<input type="hidden" name="persons|person[0]|flag_own_name"/>
									</td>		
								</tr>
							
							
								<c:set value="0" var="index" scope="page" />
									<x:forEach select="$myoutput/persons/person" var="pro">
										
												<c:choose>
													<c:when test="${index<10}">
														<c:set value="0" var="flag" scope="page" />
													</c:when>
													<c:otherwise>
														<c:set value="" var="flag" scope="page" />
													</c:otherwise>
												</c:choose>
														<tr>
															<td nowrap="true">
															<input type="radio" class="radiobutton" name="selResultPsns" >
																
															</td>
															<td nowrap="true">
																&nbsp;
																<span name="persons/person[${flag}${index}]@seq_no"><x:out select="$pro/@seq_no"/></span>
															</td>
															<td nowrap="true">
																	<input type="text" label="姓名" class="input_text required" maxlength="10" name="persons/person[${flag}${index}]/cname" value="<x:out select='$pro/cname' />"/>
															</td>
															<td nowrap="true">
																	<input type="text" label="所在单位" class="input_text required" maxlength="30" name="persons/person[${flag}${index}]/org_name"  value="<x:out select='$pro/org_name' />"/>
															</td>
															<td nowrap="true">
																	<input type="text" label="电子邮箱" class="input_text email" maxlength="30" name="persons/person[${flag}${index}]/email"  value="<x:out select='$pro/email' />"/>
															</td>
															<td nowrap="true">
																	<c:set var="flag_corresponding" scope="page">
																	<x:out select="$pro/flag_corresponding_name" />
																	</c:set>
																	 
																	<input type="checkbox"  class="checkbox"  maxlength="30" name="flag_corresponding" <c:if test="${flag_corresponding=='是'}">checked</c:if>  value=""/>
																	<input type="hidden" name="persons/person[${flag}${index}]/flag_corresponding_name"  value="<x:out select="$pro/flag_corresponding_name" />"/>
															</td>
															<td nowrap="true">
																	<c:set var="flag_own" scope="page">
																	<x:out select="$pro/flag_own_name" />
																	</c:set>
																	 
																	<input type="radio"   class="radiobutton" maxlength="30" name="flag_own" <c:if test="${flag_own=='是'}">checked</c:if> value=""/>
																	<input type="hidden" name="persons/person[${flag}${index}]/flag_own_name"  value="<x:out select="$pro/flag_own_name" />"/>
															</td>
														</tr>
														<c:set value="${index+1}" var="index" scope="page" />
								     </x:forEach>
								</c:if>
							<c:if test="${param.flag=='view'}">
								<c:set value="0" var="index" scope="page" />
									<x:forEach select="$myoutput/persons/person" var="pro">
										<c:set value="${index+1}" var="index" scope="page" />
												<c:choose>
													<c:when test="${index<10}">
														<c:set value="0" var="flag" scope="page" />
													</c:when>
													<c:otherwise>
														<c:set value="" var="flag" scope="page" />
													</c:otherwise>
												</c:choose>
														<tr>
															 
															<td nowrap="true">
																&nbsp; <x:out select="$pro/@seq_no"/> 
															</td>
															<td nowrap="true">
																	<x:out select="$pro/cname" />
															</td>
															<td nowrap="true">
																	<x:out select="$pro/org_name" />
															</td>
															<td nowrap="true">
																	<x:out select="$pro/email" />
															</td>
															<td nowrap="true">
																	<x:out select="$pro/flag_corresponding_name" />
															</td>
															<td nowrap="true">
																	<x:out select="$pro/flag_own_name" />
															</td>
													  </tr>	
								     </x:forEach>
							</c:if>
							</tbody>
						</table>
					<br>
					<c:if test="${param.flag!='view'}">
					<table width="98%" align="center">
						<tr ><td>
						<input class="button" name="cmdAddbefore" id="cmdAddbeforePsn" type=button value="添加" onclick="if(1==1){addNewRow('tblResultPsns');}try{top.resizeFrame();}catch(e){};">
						<input class="button" name="cmdMovePrev" id="cmdMovePrevPsn" type=button value="上移" onclick="movePrev('tblResultPsns','selResultPsns')">
						<input class="button" name="cmdMoveNext" id="cmdMoveNextPsn" type=button value="下移" onclick="moveNext('tblResultPsns','selResultPsns')">
						<input class="button" name="cmddel" id="cmddelPsn" type=button  value="删除" onclick="deleteSelectedRow('tblResultPsns','记录')">
						</td>
					</tr>
					</table>
					<br/>
					</c:if>
					</div>
				</DIV>
				</div>
				 
		<table width="100%" align="center">
			<tr>
				<td>
					
					<c:if test="${param.flag!='view'}">
					<input class="button" type="button" value=" 保 存 " id="saveProduct"
						onclick="saveProduct();">
					</c:if>
				
					<input class="button" type="button" value=" 取消 "
						onclick="parent.tb_remove();">
				</td>
			</tr>
		</table>
		 
		<c:if test="${param.flag!='view'}">
		<table width="100%" align="center">
					<tr ><td>
					<cpt:helpTips key="prp_products_info" id="tipsId" ></cpt:helpTips>
					</td></tr>
					</table>
		</c:if>
  </body>
</html>
